﻿using AutoMapper;
using S.Archives.Domain.S.ArchivesDto;
using S.Archives.Domain.S.ArchivesModel;

namespace S.Archives.Read.Api.Extensions.AutoMapper
{
    public class ReadProfile : Profile
    {
        public ReadProfile()
        {
            //如果有相同字段的类就写一个这个
            /*    CreateMap<SheepFileCreateCommand, SheepFileModel>().ReverseMap();*///从前往后传输相同字段的值
            //从档案根据羊只类型获取耳号下拉框
            CreateMap<SheepFileModel, EnumStringDto>().ForMember(destinationMember: des => des.Value, memberOptions: opt => { opt.MapFrom(mapExpression: map => map.EarTag); }).ForMember(destinationMember: des => des.Label, memberOptions: opt => { opt.MapFrom(mapExpression: map => map.EarTag); });
        }
    }
}